package com.zhuiyun.project.api.video.mobileVideo.mapper;

import com.zhuiyun.project.api.video.mobileVideo.entity.MobileVideo;
import com.zhuiyun.project.api.video.mobileVideo.model.MobileVideoModel;
import com.zhuiyun.project.common.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName MobileVideoMapper
 * @Description 移动端视频管理
 * @Author qsh
 * @Date 2024/3/6 8:34
 **/
@Mapper
public interface MobileVideoMapper extends BaseMapper<MobileVideo> {
    //推荐页
    @Select("select * from video v,front_user f where v.user_id = f.id and v.review_status='已通过' and v.video_status='公开' and v.is_delete=1 and v.identifying='u' order by v.like_counts Desc")
    List<MobileVideoModel> MobileVideoList();

    //视频信息（点赞、收藏、转发、评论等
    @Select("select * from video where review_status='已通过' and is_delete=1 and identifying='u'")
    List<MobileVideo> MobileVideo();

    //关注页
    @Select("select * from video v, front_user f " +
            " where v.user_id = f.id and v.user_id = #{upId} and v.review_status = '已通过' and v.is_delete = 1 and v.identifying = 'u'")
    List<MobileVideoModel> MobileVideoFollow(@Param("upId") Integer upId);
}
